// pages/list/list.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    data_list: [],
    loading: true,
    item_title: 'Loading...'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    // console.log(options)

    const reqType = options.type
    console.log(reqType)
    const reqUrl = 'https://douban.uieee.com/v2/movie/'
    var _this=this
    wx.request({
      // url: 'https://api.douban.com/v2/movie/in_theaters',
      // url:'https://douban.uieee.com/v2/movie/in_theaters',
      url:reqUrl+reqType,
      header: { 'content-type': 'application/xml' },
      success:function(result){
        console.log(result)
        _this.setData({
          item_title: result.data.title, data_list:result.data.subjects
        })
      }
    })


  }


})